package com.unicom.leetcode;

import java.util.Scanner;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2021/11/24 9:12
 * Description: 整数反转
 */
public class Sum {

    public static void main(String[] args) {

        while (true) {
            boolean tag = true;
            System.out.println("请输入整数.....");
            Scanner scanner = new Scanner(System.in);
            int a = scanner.nextInt();
            long y = 0;
            while (a != 0) {

                y = (a % 10 )  + y * 10 ;
                a = a / 10;
            }

            if (y > Math.pow(2, 31) - 1 || y < (-Math.pow(2, 31))){
                System.out.println(0);
            }else {

                System.out.println((int) y);
            }


        }
    }
}
